<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>

<body>
    <div id="app">
		<div>{{age}}</div>
		<div>{{msg}}</div>
		<button @click="handle">运算</button>
	</div>

	
    <script>
        var vm = new Vue({
            el: '#app',
            data: {
				msg:1,
				age:2,
            },methods: {
				handle:function(){
					this.msg++;
					this.age=this.age+2;
				}
			},watch:{
				msg:function(newMsg){
					console.log(newMsg)
				},
				age:function(newAge){
					console.log(newAge)
				}
			}
			
        })
    </script>
</body>

</html>